<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class My_Model extends CI_Model {
	public function __construct(){
		parent::__construct();
	}
	public function get_all(){
	    $query = $this->db->get($this->table_name);
	    return $query->result();
	}
	public function get_one($id){
	    $query = $this->db->where('id',$id)->get($this->table_name);
	    return $query->row();
	}
	public function add($data){
		$this->db->insert($this->table_name,$data);
	}
	public function edit($data,$id){
		$this->db->update($this->table_name, $data, "id = $id");
	}
	public function del($id){
		$this->db->where('id',$id)->delete($this->table_name);
	}
}